package com.dx.controller.user;


import com.dx.model.ApiResult;
import com.dx.model.user.bo.LoginBO;
import com.dx.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author YU.TAN
 * @since 2023-07-22
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 登录方法
     * <p>
     * loginAccount：user
     * password：123456
     *
     * @param
     * @return
     */
    @PostMapping("/login")
    public ApiResult login(@Valid @RequestBody LoginBO loginBO) {
        return userService.login(loginBO);
    }

}
